//
//  DBProcessing.h
//  Project6
//
//  Created by ToanDK on 12/30/12.
//  Copyright (c) 2012 DungNP. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <sqlite3.h>

#define kDataBaseName @"davedb.sqlite"
#define kNewreportTableName @"tblNewreport"
#define kDamageReportTableName @"tblDamageReport"

@interface DBProcessing : NSObject

+(void) checkAndCreateDatabase:(NSString *) databasePath dataBaseName:(NSString *) databaseName;

+(void) addNewreport:(NSMutableDictionary *) newreport onDataBase:(NSString *)databasePath;
+(void) addDamagereport:(NSMutableDictionary *) damagereport withNewreportID:(NSString *) newreportid onDataBase:(NSString *)databasePath;
/// update damage record to database
+(void) updateDamagereport:(NSMutableDictionary *) damagereport withNewreportID:(NSString *) newreportid onDataBase:(NSString *)databasePath;

+(NSString *) getLastestNewreportID:(NSString *) databasePath;
+(NSMutableArray *) readAllNewReports:(NSString *) databasePath;
+(NSMutableArray *) readAllDamageReportsByNewreportID:(NSString *)newreportid  onDatabase:(NSString*) databasePath;

+(void) deleteNewreportById:(NSString *) newreportid OnDB:(NSString *) databasePath;
+(void) deleteDamageReportByNewreportId:(NSString *) newreportid OnDB:(NSString *) databasePath;

@end
